// 水流的数据的状态鸡
import { defineStore } from 'pinia';
import { chartGet, addressGet } from '../../api/running';
export const useRuning = defineStore('run', {
    state: () => ({
        bool: false,
        runList: [],
        timeList: [],
        regionList: ['水流量'],
        citys: []
    }),
    actions: {
        // 获取图表所需数据
        async runAllAction(key: string) {
            // this.timeList = this.datasd.updateTimes
            this.bool = false
            let res = await chartGet(key);
            this.bool = true
            console.log(res);
            this.runList = res.data.results[0].instantFlows
            this.timeList = res.data.results[0].updateTimes
        },
        // 获取地区所需数据
        async addressInfo() {
            let res = await addressGet()
            this.citys = res.data.results
        }
    }
}) 